package com.twu.biblioteca.model.menu;

import com.twu.biblioteca.model.Book;
import com.twu.biblioteca.model.Movie;
import com.twu.biblioteca.model.menu.actions.*;

public enum Command {

    LIST_BOOK("1", "List All Books", new NullAction(false)),
    CHECKOUT_BOOK("2", "Checkout Book", new CheckoutAction(true, Book.class), "Enter Title", "Enter Author", "Enter Year (e.g 2014)"),
    RETURN_BOOK("3", "Return Book", new ReturnAction(true, Book.class), "Enter Title", "Enter Author", "Enter Year (e.g 2014)"),
    LIST_MOVIE("4", "List All Movies", new NullAction(false)),
    CHECKOUT_MOVIE("5", "Checkout Movie", new CheckoutAction(true, Movie.class), "Enter Title", "Enter Director", "Enter Year (e.g 2014)"),
    RETURN_MOVIE("6", "Return Movie", new ReturnAction(true, Movie.class), "Enter Title", "Enter Director", "Enter Year (e.g 2014)"),
    VIEW_DETAILS("7", "View Your Details", new NullAction(true)),
    LOGIN("L", "Login", new LoginAction(false), "Enter Library Number", "Enter Password"),
    QUIT("Quit", "Quit Application", new QuitAction(false));


    private final String key;
    private final String text;
    private final MenuAction action;
    private final String[] questions;

    private Command(String key, String text, MenuAction action, String... questions) {
        this.key = key;
        this.text = text;
        this.action = action;
        this.questions = questions;
    }

    public String getKey() {
        return key;
    }

    public String getText() {
        return text;
    }

    public MenuAction getAction() {
        return action;
    }

    public String[] getQuestions() {
        return questions;
    }
}
